<!DOCTYPE html>
<html>
<head>
   <title>CSS Animations - animation-name and inline element</title>
   <link rel="author" title="Opera Software ASA" href="http://www.opera.com/">
   <link rel="help" href="http://dev.w3.org/csswg/css3-animations/#the-animation-name-property-">
   <meta name="flags" content="dom">
   <meta name="assert" content="animation-name applies to inline elements">
   <script src="/resources/testharness.js"></script>
   <script src="/resources/testharnessreport.js"></script>
   <style type="text/css">
      @keyframes fade {
         from {
            opacity: 1;
         }
         to {
            opacity: 0;
         }
      }
      .test {
         animation-duration: 1s;
         animation-name: fade;
      }
   </style>
   <script type="text/javascript">
      setup({explicit_done:true});
      onload = function() {
         var testName = document.querySelector('title').firstChild.data;
         var span = document.querySelector('span');
         var log = document.querySelectorAll('p')[1].firstChild;
         var timeout = setTimeout(function() {
            test(function(){assert_true(false);}, testName); done();
            log.data = 'FAIL';
         }, 1500);
         span.addEventListener('animationend', function(evt) {
            clearTimeout(timeout);
            var passed = (evt.animationName == 'fade');
            test(function(){assert_true(passed);}, testName); done();
            log.data = (passed ? 'PASS if the animation occurred.' : 'FAIL');
         });
         span.className = 'test';
      }
   </script>
   <style>iframe{display:none}</style>
</head>
<body>
   <p>The uppercase word below should fade out, then reappear.</p>
   <p>Testing...</p>
   <div>normal <span>FADE</span> normal</div>
</body>
</html>
